package org.eclipse.assemblyformatter.identification;

/*import org.eclipse.hyperasm.ir.Section;
 import org.eclipse.hyperasm.ir.lowlevel.CharacterLiteral;
 import org.eclipse.hyperasm.ir.lowlevel.LineSeparator;
 import org.eclipse.hyperasm.ir.lowlevel.Symbol;
 import org.eclipse.hyperasm.ir.lowlevel.WhiteSpace;
 import org.eclipse.jface.text.BadLocationException;
 */

/**
 * This class must provide functionality for identifying the assembly language:
 * IAR, GCC, ....
 * 
 * <p>
 * <b>IAR identification: </b><br />
 * LINE_SEPARATOR + WHITE_SPACE + "SECTION" + WHITE_SPACE + ".text:"
 * </p>
 * 
 * <p>
 * <b>GCC identification: </b><br />
 * LINE_SEPARATOR + ".text"
 * </p>
 */
public class Language {
	/**
	 * This procedure is slightly different from the rule for determining if
	 * instruction has white-space before, but the most common case is covered.
	 */
	/*
	 * private boolean instructionHasWhiteSpace() { Section section = base;
	 * 
	 * while (section != null) { Section nextSection = section.getNextSection();
	 * 
	 * if (section instanceof LineSeparator) { if (nextSection != null) { if
	 * (nextSection instanceof WhiteSpace) { Section instruction =
	 * nextSection.getNextSection(); if (instruction != null) { if (instruction
	 * instanceof Symbol) { return true; } } } } }
	 * 
	 * section = nextSection; } return false; }
	 * 
	 * public static enum LabelIdentificationState { LINE_SEPARATOR, SYMBOL,
	 * WHITE_SPACE, CHARACTER_LITERAL }
	 * 
	 * private boolean labelHasColon() throws BadLocationException {
	 * LabelIdentificationState state = LabelIdentificationState.LINE_SEPARATOR;
	 * Section section = base;
	 * 
	 * while (section != null) { Section nextSection = section.getNextSection();
	 * 
	 * switch (state) { case LINE_SEPARATOR: if (section instanceof
	 * LineSeparator) { state = LabelIdentificationState.SYMBOL; } else { //
	 * Stay in current state. } break; case SYMBOL: if (section instanceof
	 * Symbol) { state = LabelIdentificationState.WHITE_SPACE; } else { // Reset
	 * state. state = LabelIdentificationState.LINE_SEPARATOR; } break; case
	 * WHITE_SPACE: if (section instanceof WhiteSpace) { state =
	 * LabelIdentificationState.CHARACTER_LITERAL; break; } else { //
	 * WHITE_SPACE is optional. if (section instanceof CharacterLiteral) { state
	 * = LabelIdentificationState.CHARACTER_LITERAL; // Enter next case
	 * (CHARACTER_LITERAL). } else { // Reset state. state =
	 * LabelIdentificationState.LINE_SEPARATOR; break; } } // No break case
	 * CHARACTER_LITERAL: if (section instanceof CharacterLiteral) { if
	 * (doc.getChar(section.getOffset()) == ':') { return true; } } // Reset
	 * state. state = LabelIdentificationState.LINE_SEPARATOR; break; default:
	 * // Reset state. state = LabelIdentificationState.LINE_SEPARATOR; }
	 * section = nextSection; } return false; }
	 */
}
